import VueRouter from 'vue-router'

// 导入对应的路由组件
import index from './components/tabbar/index.vue'                        //首页
import classify from './components/tabbar/classify.vue'                  //分类
import cart from './components/tabbar/cart.vue'                          //购物车
import user from './components/tabbar/user.vue'                          //我的
import exchange from './components/indexSub/exchange.vue'                  //实物卡兑换
import discount from './components/indexSub/discount.vue'                  //打折促销
import coupon from './components/userSub/coupon.vue'                  //优惠券



// 3. 创建路由对象
var router = new VueRouter({
  routes: [ // 配置路由规则
    { path: '/', redirect: '/index' },
    { path: '/index', component: index },
    { path: '/classify', component: classify },
    { path: '/cart', component: cart },
    { path: '/user', component: user },
    { path: '/exchange', component: exchange },
    { path: '/discount', component: discount },
    { path: '/discount', component: discount },
    { path: '/coupon', component: coupon },

  ],
  linkActiveClass: 'mui-active' // 覆盖默认的路由高亮的类，默认的类叫做 router-link-active
})

// 把路由对象暴露出去
export default router